using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._ModelTools._ModelOnly
{
    /// <summary>
    /// <para>Parse Path</para>
    /// <para>The Parse Path tool parses the input into its file, path, name, or extension. The output can be used as inline variable in the output name of other tools.</para>
    /// <para>解析路径工具将输入解析为其文件、路径、名称或扩展名。输出可以用作其他工具的输出名称中的内联变量。</para>
    /// </summary>    
    [DisplayName("Parse Path")]
    public class ParsePath : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public ParsePath()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_data_element">
        /// <para>Input Values</para>
        /// <para>Input values that you want to parse.</para>
        /// <para>要分析的输入值。</para>
        /// </param>
        public ParsePath(object _in_data_element)
        {
            this._in_data_element = _in_data_element;
        }
        public override string ToolboxName => "Model Tools";

        public override string ToolName => "Parse Path";

        public override string CallName => "mb.ParsePath";

        public override List<string> AcceptEnvironments => [];

        public override object[] ParameterInfo => [_in_data_element, _parse_type.GetGPValue(), _value];

        /// <summary>
        /// <para>Input Values</para>
        /// <para>Input values that you want to parse.</para>
        /// <para>要分析的输入值。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Values")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_data_element { get; set; }


        /// <summary>
        /// <para>Parse type</para>
        /// <para><xdoc>
        ///   <para>Specifies the parse type.</para>
        ///   <para>Given an input value of C:\ToolData\InputFC.shp:</para>
        ///   <bulletList>
        ///     <bullet_item>File name and extension—Output will be the file. Example: InputFC.shp</bullet_item><para/>
        ///     <bullet_item>File path—Output will be the file path. Example: C:\ToolData</bullet_item><para/>
        ///     <bullet_item>File name—Output will be the file name. Example: InputFC</bullet_item><para/>
        ///     <bullet_item>File extension—Output will be the file extension. Example: shp</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定分析类型。</para>
        ///   <para>给定输入值 C：\ToolData\InputFC.shp：</para>
        ///   <bulletList>
        ///     <bullet_item>文件名和扩展名 - 输出将是文件。示例：InputFC.shp</bullet_item><para/>
        ///     <bullet_item>文件路径 - 输出将为文件路径。示例：C：\ToolData</bullet_item><para/>
        ///     <bullet_item>文件名 - 输出将为文件名。示例：InputFC</bullet_item><para/>
        ///     <bullet_item>文件扩展名 - 输出将是文件扩展名。示例：shp</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Parse type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _parse_type_value _parse_type { get; set; } = _parse_type_value._FILE;

        public enum _parse_type_value
        {
            /// <summary>
            /// <para>File name and extension</para>
            /// <para>File name and extension—Output will be the file. Example: InputFC.shp</para>
            /// <para>文件名和扩展名 - 输出将是文件。示例：InputFC.shp</para>
            /// </summary>
            [Description("File name and extension")]
            [GPEnumValue("FILE")]
            _FILE,

            /// <summary>
            /// <para>File path</para>
            /// <para>File path—Output will be the file path. Example: C:\ToolData</para>
            /// <para>文件路径 - 输出将为文件路径。示例：C：\ToolData</para>
            /// </summary>
            [Description("File path")]
            [GPEnumValue("PATH")]
            _PATH,

            /// <summary>
            /// <para>File extension</para>
            /// <para>File extension—Output will be the file extension. Example: shp</para>
            /// <para>文件扩展名 - 输出将是文件扩展名。示例：shp</para>
            /// </summary>
            [Description("File extension")]
            [GPEnumValue("EXTENSION")]
            _EXTENSION,

            /// <summary>
            /// <para>File name</para>
            /// <para>File name and extension—Output will be the file. Example: InputFC.shp</para>
            /// <para>文件名和扩展名 - 输出将是文件。示例：InputFC.shp</para>
            /// </summary>
            [Description("File name")]
            [GPEnumValue("NAME")]
            _NAME,

        }

        /// <summary>
        /// <para>Value</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Value")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _value { get; set; }


        public ParsePath SetEnv()
        {
            base.SetEnv();
            return this;
        }

    }

}